/**
 * @author mkorb
 */

var flashVersion = 0;
var maxVersion = 99;
var version = navigator.appVersion;
var agent = navigator.userAgent;
var plugs = navigator.plugins;
var isIE = version.indexOf("MSIE") > 0;
var isWin = version.indexOf("Windows") > 0;
var isMac45 = version.indexOf("Mac") > 0 && version.indexOf("4.5") > 0;
var isOpera = agent.indexOf("Opera") > 0;

if(isIE && isMac45) {
  alert("Please update your browser for a better surfing experience.");
}

if(isIE && isWin &&! isOpera) {
  var n = '\n';
  var tags = '<scr'+'ipt language=vbscript>'+ n +'on error resume next'+ n;
  var i = 1;
  while(i++ < maxVersion) {
    tags += 'isFlash'+ i +'=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'")))'+ n;
  }
  document.write(tags+'</scr'+'ipt>'+ n);
}

if(plugs && (plugs["Shockwave Flash 2.0"] || plugs["Shockwave Flash"])) {
  var diz = plugs["Shockwave Flash"+ (plugs["Shockwave Flash 2.0"] ? "2.0" : "")].description;
  var i = 1;
  while(i++ < maxVersion) {
    this["isFlash"+ i] = diz.charAt(diz.indexOf(".") - 1) * 1 == i;
  }
}

var i = 1;
while(i++ < maxVersion) {
  if(this["isFlash"+ i]) {
    flashVersion = i;
  }
  if(agent.indexOf("WebTV") > 0) {
    flashVersion = 3;
  }
}